package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;

/**
 * <p>
 * 职位
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
@TableName("tm_org_position")
public class OrgPositionPO extends DMSBasePO<OrgPositionPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 职位ID
     */
        @TableId(value = "ORG_POSITION_ID", type = IdType.AUTO)
        private Integer orgPositionId;
    /**
     * 经销商代码
     */
    @TableField("OWNER_CODE")
    private String dealerCode;

    @TableField("COMPANY_ID")
    private String companyId;

    /**
     * 职位代码
     */
    @TableField("POSITION_CODE")
    private String positionCode;
    /**
     * 职位名称
     */
    @TableField("POSITION_NAME")
    private String positionName;
    /**
     * 职位描述
     */
    @TableField("POSITION_DESC")
    private String positionDesc;
    /**
     * 数据来源
     */
    @TableField("DATA_SOURCE")
    private Integer dataSource;
    /**
     * 职位类型
     */
    @TableField("DATA_TYPE")
    private Integer dataType;
    /**
     * 是否有效
     */
    @TableField("IS_VALID")
    private Integer isValid;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public OrgPositionPO() {
        super();
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @Override
    public String toString() {
        return "OrgPositionPO{" +
                "orgPositionId=" + orgPositionId +
                ", dealerCode='" + dealerCode + '\'' +
                ", companyId='" + companyId + '\'' +
                ", positionCode='" + positionCode + '\'' +
                ", positionName='" + positionName + '\'' +
                ", positionDesc='" + positionDesc + '\'' +
                ", dataSource=" + dataSource +
                ", dataType=" + dataType +
                ", isValid=" + isValid +
                ", isDeleted=" + isDeleted +
                '}';
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public Integer getOrgPositionId() {
        return orgPositionId;
    }

    public void setOrgPositionId(Integer orgPositionId) {
        this.orgPositionId = orgPositionId;
    }

    public String getDealerCode() {
        return dealerCode;
    }

    public void setDealerCode(String dealerCode) {
        this.dealerCode = dealerCode;
    }

    public String getPositionCode() {
        return positionCode;
    }

    public void setPositionCode(String positionCode) {
        this.positionCode = positionCode;
    }

    public String getPositionName() {
        return positionName;
    }

    public void setPositionName(String positionName) {
        this.positionName = positionName;
    }

    public String getPositionDesc() {
        return positionDesc;
    }

    public void setPositionDesc(String positionDesc) {
        this.positionDesc = positionDesc;
    }

    public Integer getDataSource() {
        return dataSource;
    }

    public void setDataSource(Integer dataSource) {
        this.dataSource = dataSource;
    }

    public Integer getDataType() {
        return dataType;
    }

    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.orgPositionId;
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "orgPositionId");
    }


}
